<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>WEB 服务器</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <script src="js/echarts.common.min.js"></script>
  <script src="js/echarts-liquidfill.min.js"></script>
  <link rel="stylesheet" href="layui/css/layui.css" media="all">
</head>

<body>
  <div id="histogram" style="width: 940px;height:400px"></div>
  <div style="padding: 20px; background-color: #F2F2F2;">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md6">
        <div class="layui-card">
          <div class="layui-card-header">报警内容</div>
          <div class="layui-card-body">
            一级报警：通信接口设备故障：环境接口，报警时间：2019/04/26/ 09:56:20;开关量状态：落下
          </div>
        </div>
      </div>
    </div>
  <script type="text/javascript">
    // 柱形图显示
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('histogram'));
    var dataAxis = ["1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00"
    , "18:00", "19:00", "20:00", "21:00", "22:00", "23:00", "24:00"]
    var datayAxis = [99, 88, 40, 90, 20, 95, 90, 95, 99]
    var openDate = [30, 15, 30, 15, 15, 15, 30,0]

    // 指定图表的配置项和数据
    option = {
      //color: ['#40e0d0'],
      title: {
        text: '报警信息'
      },
      tooltip: {
        trigger: 'axis'
      },
      legend: {
        data: ['曲线','开关量状态']
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
      toolbox: {
        feature: {
          savaAsImage: {}
        }
      },
      xAxis: {
        data: dataAxis,
      },
      yAxis: {
      },
      series: [
        {
          name: '曲线',
          type: 'line',
          smooth: true,
          data: datayAxis,
        }, {
          name: '开关量状态',
          type: 'line',
          //smooth: true,
          step:'end',
          data: openDate,
        }
      ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  </script>
</body>

</html>